<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja" id="main">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>WebAudio Class</title>
	<link rel="stylesheet" href="../inc/css/style.min.css" />
	<script type="text/javascript" src="../inc/js/lib/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="../inc/js/common.js"></script>
</head>
<body>

	<div class="main">

		<h1 class="main__title--h1 main__title--h1--v07">WebAudio Class</h1>
		<ul class="breadcrumb">
			<li>JSライブラリ</li>
			<li>&gt;</li>
			<li>WebAudio Class</li>
		</ul>
		<p>The audio object of Web Audio API.</p>
		<div class="main__section">
			<h2 class="main__title--h2">Constructor</h2>
<pre class="main__pre--code">
WebAudio ( url )
</pre>
			<div class="params">
				<h4>Parameters:</h4>

				<ul class="params-list">
					<li class="param">
						<code class="param-name">url</code>
						<span class="type">String</span>
						<div class="param-description">
							<p>The url of the audio file</p>
						</div>
					</li>
				</ul>
			</div>
		</div><!-- /main__section -->



		<div class="main__section">
			<h2 class="main__title--h2">Item Index</h2>
			<b>Methods</b>
			<ul class="main__ul--inline">
				<li><a href="#m01">addLoadListener</a></li>
				<li><a href="#m02">addStopListener</a></li>
				<li><a href="#m03">canPlayM4a</a> <span>static</span></li>
				<li><a href="#m04">canPlayOgg</a> <span>static</span></li>
				<li><a href="#m05">clear</a></li>
				<li><a href="#m06">fadeIn</a></li>
				<li><a href="#m07">fadeOut</a></li>
				<li><a href="#m08">initialize</a> <span>static</span></li>
				<li><a href="#m09">isError</a></li>
				<li><a href="#m10">isPlaying</a></li>
				<li><a href="#m11">isReady</a></li>
				<li><a href="#m12">play</a></li>
				<li><a href="#m13">seek</a></li>
				<li><a href="#m14">stop</a></li>
			</ul>

			<b>Properties</b>
			<ul class="main__ul--inline">
				<li><a href="#p01">pan</a></li>
				<li><a href="#p02">pitch</a></li>
				<li><a href="#p03">url</a></li>
				<li><a href="#p04">volume</a></li>
			</ul>
		</div><!-- /main__section -->


		<div class="main__section">
			<h2 class="main__title--h2">Methods</h2>

			<div id="m01" class="main__subsection">
<pre class="main__pre--code">
addLoadListener ( listner )
</pre>
				<p class="mb10px">Add a callback function that will be called when the audio data is loaded.</p>
				<div class="params">
					<h4>Parameters:</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">listner</code>
							<span class="type">Function</span>
							<div class="param-description">
								<p>The callback function</p>
							</div>
						</li>
					</ul>
				</div>
			</div><!-- /div -->

			<div id="m02" class="main__subsection">
<pre class="main__pre--code">
addStopListener ( listner )
</pre>
				<p class="mb10px">Add a callback function that will be called when the playback is stopped.</p>
				<div class="params">
					<h4>Parameters:</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">listner</code>
							<span class="type">Function</span>
							<div class="param-description">
								<p>The callback function</p>
							</div>
						</li>
					</ul>
				</div>
			</div><!-- /div -->

			<div id="m03" class="main__subsection">
<pre class="main__pre--code">
canPlayM4a () <span class="pre__type">Boolean</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">Checks whether the browser can play m4a files.</p>
				<div class="params">
					<h4>Returns:</h4>
					<p><span class="pre__type">Boolean:</span> <br />
					True if the browser can play m4a files</p>
				</div>
			</div><!-- /div -->

			<div id="m04" class="main__subsection">
<pre class="main__pre--code">
canPlayOgg () <span class="pre__type">Boolean</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">Checks whether the browser can play ogg files.</p>
				<div class="params">
					<h4>Returns:</h4>
					<p><span class="pre__type">Boolean:</span> <br />
					True if the browser can play ogg files</p>
				</div>
			</div><!-- /div -->

			<div id="m05" class="main__subsection">
<pre class="main__pre--code">
clear ()
</pre>
				<p class="mb10px">Clears the audio data.</p>
			</div><!-- /div -->

			<div id="m06" class="main__subsection">
<pre class="main__pre--code">
fadeIn ( duration )
</pre>
				<p class="mb10px">Performs the audio fade-in.</p>
				<div class="params">
					<h4>Parameters:</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">duration</code>
							<span class="type">Number</span>
							<div class="param-description">
								<p>Fade-in time in seconds</p>
							</div>
						</li>
					</ul>
				</div>
			</div><!-- /div -->

			<div id="m07" class="main__subsection">
<pre class="main__pre--code">
fadeOut ( duration )
</pre>
				<p class="mb10px">Performs the audio fade-out.</p>
				<div class="params">
					<h4>Parameters:</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">duration</code>
							<span class="type">Number</span>
							<div class="param-description">
								<p>Fade-out time in seconds</p>
							</div>
						</li>
					</ul>
				</div>
			</div><!-- /div -->

			<div id="m08" class="main__subsection">
<pre class="main__pre--code">
initialize ( noAudio ) <span class="pre__type">Boolean</span> <span class="pre__static">[static]</span>
</pre>
				<p class="mb10px">Initializes the audio system.</p>
				<div class="params">
					<h4>Parameters:</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">noAudio</code>
							<span class="type">Boolean</span>
							<div class="param-description">
								<p>Flag for the no-audio mode</p>
							</div>
						</li>
					</ul>
					<h4>Returns:</h4>
					<p><span class="pre__type">Boolean:</span> <br />
					True if the audio system is available</p>
				</div>
			</div><!-- /div -->

			<div id="m09" class="main__subsection">
<pre class="main__pre--code">
isError () <span class="pre__type">Boolean</span>
</pre>
				<p class="mb10px">Checks whether a loading error has occurred.</p>
				<div class="params">
					<h4>Returns:</h4>
					<p><span class="pre__type">Boolean:</span> <br />
					True if a loading error has occurred</p>
				</div>
			</div><!-- /div -->

			<div id="m10" class="main__subsection">
<pre class="main__pre--code">
isPlaying () <span class="pre__type">Boolean</span>
</pre>
				<p class="mb10px">Checks whether the audio is playing.</p>
				<div class="params">
					<h4>Returns:</h4>
					<p><span class="pre__type">Boolean:</span> <br />
					True if the audio is playing</p>
				</div>
			</div><!-- /div -->

			<div id="m11" class="main__subsection">
<pre class="main__pre--code">
isReady () <span class="pre__type">Boolean</span>
</pre>
				<p class="mb10px">Checks whether the audio data is ready to play.</p>
				<div class="params">
					<h4>Returns:</h4>
					<p><span class="pre__type">Boolean:</span> <br />
					True if the audio data is ready to play</p>
				</div>
			</div><!-- /div -->

			<div id="m12" class="main__subsection">
<pre class="main__pre--code">
play ( loop , offset )
</pre>
				<p class="mb10px">Checks whether the audio data is ready to play.</p>
				<div class="params">
					<h4>Parameters:</h4>
					<ul class="params-list">
						<li class="param">
							<code class="param-name">loop</code>
							<span class="type">Boolean</span>
							<div class="param-description">
								<p>Whether the audio data play in a loop</p>
							</div>
						</li>
						<li class="param">
							<code class="param-name">offset</code>
							<span class="type">Number</span>
							<div class="param-description">
								<p>The start position to play in seconds</p>
							</div>
						</li>
					</ul>
				</div>
			</div><!-- /div -->

			<div id="m13" class="main__subsection">
<pre class="main__pre--code">
seek ()
</pre>
				<p class="mb10px">Gets the seek position of the audio.</p>
			</div><!-- /div -->

			<div id="m14" class="main__subsection">
<pre class="main__pre--code">
stop ()
</pre>
				<p class="mb10px">Stops the audio.</p>
			</div><!-- /div -->


		</div><!-- /main__section -->


		<div class="main__section">
			<h2 class="main__title--h2">Properties</h2>

			<div id="p01" class="main__subsection">
<pre class="main__pre--code">
pan <span class="pre__type">Number</span>
</pre>
				<p class="mb10px">The pan of the audio.</p>
			</div><!-- /div -->

			<div id="p02" class="main__subsection">
<pre class="main__pre--code">
pitch <span class="pre__type">Number</span>
</pre>
				<p class="mb10px">The pitch of the audio.</p>
			</div><!-- /div -->

			<div id="p03" class="main__subsection">
<pre class="main__pre--code">
url <span class="pre__type">String</span>
</pre>
				<p class="mb10px">[read-only] The url of the audio file.</p>
			</div><!-- /div -->

			<div id="p04" class="main__subsection">
<pre class="main__pre--code">
volume <span class="pre__type">Number</span>
</pre>
				<p class="mb10px">The volume of the audio.</p>
			</div><!-- /div -->

		</div><!-- /main__section -->

	</div><!-- /main -->

</body>
</html>